package com.example.makerspace.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.makerspace.mapper.MybatisListHandler;
import com.example.makerspace.mapper.MybatisMapHandler;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.List;
import java.util.Map;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName(value = "t_user_project",autoResultMap = true)
@Document(indexName = "t_user_project")
public class UserProjectDO extends  BaseDO{
    private   String username;
    private   Integer projectId;
    private   String projectName;
    private   String projectDescription;
    private   String  visibility;
    private   String  defaultBranch;
    private   String   projectLink;
    private  String  sshLink;
    private  String avatar;
    @Field(name = "praise_user", type = FieldType.Text, analyzer="ik_max_word")
    @TableField(typeHandler = MybatisListHandler.class)
    private List<String> praiseUser;
    private  String projectSize;
    private  Integer praiseNumber;
    private  String committedDate;
    private  String committedMessage;
    private  Integer weekViewNumber;
    private  Integer monthViewNumber;
    @Field(name = "praise_user", type = FieldType.Text, analyzer="ik_max_word")
    @TableField(typeHandler = MybatisMapHandler.class)
    private    Map<String,String> collaboration;
}
